package nl.hu.verbrandendephoenix.view;

import java.util.ArrayList;

import nl.hu.verbrandendephoenix.shared.Product;

import com.google.gwt.user.client.ui.*;

public class AddProduct {

	private Grid grdProductForm;
	private Panel pnlProductForm;
	private Label lblProdName, lblProdDesc, lblProdPrice, lblProdCat, lblOwner1, lblOwner2;
	private TextBox txtProdName, txtProdDesc, txtProdPrice, txtProdCat;
	private Button btnConfirm;

	public AddProduct(){
		pnlProductForm = new VerticalPanel();
	}

	public Panel ConstructForm(){
		//Het aanmaken van het productpaneel

		grdProductForm = new Grid(5,3);

		lblProdName = new Label("Product Naam:");
		txtProdName = new TextBox();

		grdProductForm.setWidget(0, 0, lblProdName);
		grdProductForm.setWidget(0, 1, txtProdName);

		lblProdPrice = new Label("Prijs:");
		txtProdPrice = new TextBox();

		grdProductForm.setWidget(1, 0, lblProdPrice);
		grdProductForm.setWidget(1, 1, txtProdPrice);

		lblProdCat = new Label("Categorie: ");
		txtProdCat = new TextBox();

		grdProductForm.setWidget(2, 0, lblProdCat);
		grdProductForm.setWidget(2, 1, txtProdCat);

		lblProdDesc = new Label("Beschrijf het product");
		txtProdDesc = new TextBox();

		grdProductForm.setWidget(3, 0, lblProdDesc);
		grdProductForm.setWidget(3, 1, txtProdDesc);

		btnConfirm = new Button("Confirm");

		grdProductForm.setWidget(4, 1, btnConfirm);

		pnlProductForm.add(grdProductForm);	


		return pnlProductForm;
	}

	public ArrayList<TextBox> getArrTextBox(){
		ArrayList<TextBox> arrTextBox = new ArrayList<TextBox>();
		arrTextBox.add(txtProdName);
		arrTextBox.add(txtProdPrice);
		arrTextBox.add(txtProdCat);
		arrTextBox.add(txtProdDesc);

		return arrTextBox;

	}

	public TextBox getTxtProdName(){
		return txtProdName;

	}

	public TextBox getTxtProdPrice(){
		return txtProdPrice;

	}
	
	public TextBox getTxtProdCat(){
		return txtProdCat;
		
	}

	public TextBox getTxtProdDesc(){
		return txtProdDesc;
		
	}

	public Button getBtnConfirm() {
		return btnConfirm;
	}

}
